//JavaScript Doccument
var app = Common.initApp(['ngAnimate', 'ui.bootstrap', 'angular.filter'  ]);
Common.initDirective(app);//初始化自定义指令
File.init(app);
app.controller('relevancebusinessController', ['$scope', '$http', 
    function ($scope, $http ) {		
        $scope.relevancebusiness = {};
        $scope.clearrelevanceBusiness = function() {
            $scope.relevancebusiness = {};
        }

        //设置form业务表单信息
        $scope.fillRelevanceBusiness = function(data) {
            if (data) { //设置json格式数据到form表单中
                $scope.relevancebusiness = data;
            }
        };

        //查询渲染填充数据到form表单(用于修改信息前的查询渲染数据)
        if ( null != $scope.XH &&  'undefined' != typeof($scope.XH) &&  '' !=  $scope.XH && 1==1) {//业务主键不为空,查询填充数据
            Common.send($scope, $http , {
                method : "POST",
                url : Common.webRoot() + '/business/relevance/business/relevancebusinesscontroller/detailData/' + $scope.XH,
                data : {},
                success : function(response) {
                    $scope.fillRelevanceBusiness(response.data.model);//返回查询结果集,渲染填充数据到form表单
                }
            });
        }else{
			throw "未初始化页面序号";
		}

    }]);
